# Contributor: Adam Thiede <me@adamthiede.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=ly
pkgver=0.6.0
pkgrel=1
pkgdesc="Display manager with console UI"
url="https://github.com/fairyglade/ly"
arch="all"
license="WTFPL"
makedepends="
	coreutils
	libx11-dev
	libxcb-dev
	linux-headers
	linux-pam-dev
	"
checkdepends="valgrind"
subpackages="$pkgname-openrc"
options="!check" # test is interactive

# Dependencies do not have releases. argoat and termbox_next have tags, but the
# tags are not recent, and I'd rather be consistent between all 4 dependencies.
_argoat=e1844c4c94b70bb351ec2bd2ac6bb320ee793d8f
_configator=8cec1786196ae6f6a8b35e66181277457f2a2bb2
_dragonfail=15bd3299bf3e49bd6734bff385cb0392cd2fa502
_termbox_next=d961a8122210010e7c2c8f201e61170c13d319b4

source="$pkgname-$pkgver.tar.gz::https://github.com/fairyglade/ly/archive/refs/tags/v$pkgver.tar.gz
	$pkgname-argoat-$_argoat.tar.gz::https://github.com/nullgemm/argoat/archive/$_argoat.tar.gz
	$pkgname-configator-$_configator.tar.gz::https://github.com/nullgemm/configator/archive/$_configator.tar.gz
	$pkgname-dragonfail-$_dragonfail.tar.gz::https://github.com/nullgemm/dragonfail/archive/$_dragonfail.tar.gz
	$pkgname-termbox_next-$_termbox_next.tar.gz::https://github.com/nullgemm/termbox_next/archive/$_termbox_next.tar.gz

	version-macro.patch
	"

prepare() {
	default_prepare

	mv -Tv "$srcdir"/argoat-$_argoat sub/argoat
	mv -Tv "$srcdir"/configator-$_configator sub/configator
	mv -Tv "$srcdir"/dragonfail-$_dragonfail sub/dragonfail
	mv -Tv "$srcdir"/termbox_next-$_termbox_next sub/termbox_next
}

build() {
	make LY_VERSION=$pkgver
}

check() {
	make leak
}

package() {
	make DESTDIR="$pkgdir" install installopenrc
}

sha512sums="
a59d2ae8002a657ebdd72b8918f7d47504fbc49480dcd881da8f87550c595c89526e4117672ed4fbf1f6d5542819055b5d65658fb2bcd9b708271645df3d06d1  ly-0.6.0.tar.gz
c82b39c2fcc152076528ffebd3e62d7d69e171853077a2ab6d6e4b8df49942bad7fe2817736b76630fb813fc1bf44b16d25bf78a0addf81448427288b9935dda  ly-argoat-e1844c4c94b70bb351ec2bd2ac6bb320ee793d8f.tar.gz
0ecb0590fb29dd1c2468cbffb5b3a1ff8720543b8802b0af903c48f64c4bee76c3105166c25c900ab168ab86de63cefbe1d20bb80b80a91e8448f7848a995d0b  ly-configator-8cec1786196ae6f6a8b35e66181277457f2a2bb2.tar.gz
d68a6bfe21e07901e5c4c6c21b1aaf1397ed60f9aa59525c894970dfd78f174d52892df86ba84d13df859c8dbd863e1de1a1e6b4f1069dcc843eebaae56f5730  ly-dragonfail-15bd3299bf3e49bd6734bff385cb0392cd2fa502.tar.gz
8e69f3c886cc70601289f1e50b2a5fb9cc3eeb8eed2090cdd2e08114ab1d629fd8fe83e217eb0b189c0cfa58b397baf3b30409f712d64c8a4f208a1fffd4e7db  ly-termbox_next-d961a8122210010e7c2c8f201e61170c13d319b4.tar.gz
a7f8817c68ca9b6761e7cce51098edacac445ff26817fbd3517a3bd8e68a66857ce6ac9b9d50bfff5b93367846531cb5092f091438c32888c2ca91cf4b3e5afc  version-macro.patch
"
